// StandardMouse.cpp: implementation of the CStandardMouse class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ansiterminal.h"
#include "StandardMouse.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CStandardMouse::CStandardMouse()
{
	m_pEvents = NULL;
}

CStandardMouse::~CStandardMouse()
{

}

void CStandardMouse::RegisterEvents(IVirtualMouseEvents *pEvents)
{
	m_pEvents = pEvents;
}

void CStandardMouse::OnMouseDown(CPoint ptCell, UINT nFlags)
{
	if(m_pEvents)
	{
		m_pEvents->OnMouseDown(ptCell, nFlags);
	}
}

void CStandardMouse::OnMouseMove(CPoint ptCell, UINT nFlags)
{
	if(m_pEvents)
	{
		m_pEvents->OnMouseMove(ptCell, nFlags);
	}
}

void CStandardMouse::OnMouseUp(CPoint ptCell, UINT nFlags)
{
	if(m_pEvents)
	{
		m_pEvents->OnMouseUp(ptCell, nFlags);
	}
}
// 
// BOOL CStandardMouse::OnSetCursor(CPoint ptCell)
// {
// 	if(m_pEvents)
// 	{
// 		return m_pEvents->OnSetCursor(ptCell);
// 	}
// 	return FALSE;
// }

void CStandardMouse::OnMouseWheel(CPoint ptCell, UINT nFlags, short wheelNotches)
{
	if(m_pEvents)
	{
		m_pEvents->OnMouseWheel(ptCell, nFlags, wheelNotches);
	}
}

void CStandardMouse::Freeze(BOOL bFreeze)
{
	if(m_pEvents)
	{
		m_pEvents->OnFreezeMouse(bFreeze);
	}
}